//
//  MarkerPiaceCell.m
//  XinKaiFa55like
//
//  Created by 55like on 2017/9/26.
//  Copyright © 2017年 55like lj. All rights reserved.
//

#import "MarkerPiaceCell.h"

@implementation MarkerPiaceCell





-(void)passConTextChange:(id)sender{
    UITextField* target=(UITextField*)sender;
    NSLog(@"%@",target.text);
    
    if (self.textBlock) {
        self.textBlock(target.text, self.indexPath);
    }
    
    
}
-(UITextField *)textField{
    
    
    if (!_textField) {
        
        UITextField * baseTextField = [[UITextField alloc]init];
        baseTextField.delegate = self;
        [baseTextField setKeyboardType:UIKeyboardTypeDefault];
        [baseTextField setBorderStyle:UITextBorderStyleNone];
        [baseTextField setTextColor:rgbTitleDeepGray];
        baseTextField.font=Font(15);
        [baseTextField setSecureTextEntry:NO];
        [baseTextField setReturnKeyType:UIReturnKeyDone];
        baseTextField.textAlignment = NSTextAlignmentRight;
        baseTextField.placeholder = @"请输入";
        [baseTextField addTarget:self action:@selector(passConTextChange:) forControlEvents:UIControlEventEditingChanged];
        //注意：事件类型是：`UIControlEventEditingChanged`
        
        [self addSubview:baseTextField];
        _textField = baseTextField;
        
    }
    
    
    return _textField;
}

-(UILabel *)titleLab{
    if (!_titleLab) {
        UILabel * lab = [[UILabel alloc]init];
        lab.textColor = rgbTitleDeepGray;
        lab.font = Font(15);
        lab.textAlignment = NSTextAlignmentLeft;
        lab.numberOfLines = 0;
        [self addSubview:lab];
        _titleLab = lab;
        
    }
    return _titleLab;
    
}
-(UIImageView *)icon{
    if (!_icon) {
        UIImageView * icon = [[UIImageView alloc]init];
        [self addSubview:icon];
        _icon = icon;
        
    }
    return _icon;
    
}
-(UIView *)line{
    
    if (!_line) {
        
        UIView * line = [RHMethods lineViewWithFrame:CGRectMake(0, self.frameHeight - 1, kScreenWidth, 1)];
        [self addSubview:line];
        _line = line;
        
        
    }
    
    return _line;
}
//已经结束编辑
-(void)textFieldDidEndEditing:(UITextField *)textField{
    
    
    
    
}
//return键触发方法
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
    
    [self endEditing:YES];
    
    return YES;
}
@end
